import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { ConfigModule } from '@nestjs/config';
import { ConfigModule as GlobalConfigModule } from './config/config.module';
import { RecipeModule } from './modules/recipe/recipe.module';
import { LoggerModule } from './common/logger';
import { LogLevel } from './common/logger/logger.config';
@Module({
  imports: [
    LoggerModule.forRoot({
      logLevel: (process.env.LOG_LEVEL as LogLevel) || LogLevel.INFO,
      logDir: process.env.LOG_DIR || 'logs',
      maxFiles: process.env.LOG_MAX_FILES || '14d',
      maxSize: process.env.LOG_MAX_SIZE || '20m',
    }),
    ConfigModule,
    GlobalConfigModule,
    RecipeModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
